package models

import (
	"github.com/astaxie/beego/orm"
	"time"
	_ "github.com/go-sql-driver/mysql"
)

var ormObject orm.Ormer

func Init(){
	orm.RegisterDriver("mysql", orm.DRMySQL)
	orm.RegisterDataBase("default", "mysql", "root:123456@tcp(192.168.1.244:3306)/blog?charset=utf8&loc=Local")
	orm.RunSyncdb("default", false, true)
	orm.DefaultTimeLoc = time.UTC
	orm.RegisterModel(
		new(Menu),
	)
}

func GetOrm() orm.Ormer {
	return ormObject
}